-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support Vite 6 and update deps #770
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
❌ Deploy Preview for histoire-examples-svelte3 failed.
|
❌ Deploy Preview for histoire-examples-vue3 failed.
|
❌ Deploy Preview for histoire-site failed.
|
❌ Deploy Preview for histoire-controls failed.
|
histoire
@histoire/app
@histoire/plugin-nuxt
@histoire/plugin-percy
@histoire/controls
@histoire/plugin-screenshot
@histoire/plugin-svelte
@histoire/plugin-vue
@histoire/shared
@histoire/vendors
commit: |
3f22176 remove story:build from workflows (Graeme Byrne) 76d7665 fix readingTime error (Graeme Byrne) eb96c60 fix linting errors (Graeme Byrne) 7b33824 migrate to svelte 5 and update dependencies (Graeme Byrne) Pull request description: * Migrate from Svelte 4 to Svelte 5 as mentioned in this [issue](#106). * Update dependencies in `package.json` such as Vite which were preventing the successful migration to Svelte 5. * Upgrade ESLint to v9 as v8 has recently reached end of life and is no longer maintained, as mentioned [here](https://eslint.org/docs/latest/use/migrate-to-9.0.0). * Upgrade Sass as current syntax is deprecated as mentioned [here](https://sass-lang.com/documentation/breaking-changes/legacy-js-api/) * Remove `/contributors` route as it is redundant since we now display GitHub contributors on home page and on Community page. Existing individual contributor pages have been retained and are accessible by clicking on the author's name in the blog post. * Remove Histoire as it doesn't support Vite at the minute. There is currently a [PR](histoire-dev/histoire#770) open to fix this, so Histoire can be added back later if needed. * When navigating to a new page, the site wouldn't scroll up to the top as would be expected. As found [here](sveltejs/kit#8723), this seems to be a Svelte issue. Solve this by adding the below code to the script block of routes/+layout.svelte and bind to page content: ``` import { onNavigate } from '$app/navigation'; let contentDiv: HTMLElement | null = null; onNavigate((navigation) => { return new Promise((resolve) => { const transition = document.startViewTransition(async () => { if (contentDiv) { // Fix scroll contentDiv.scrollTop = 0; } resolve(); await navigation.complete; }); }); }); ... <div id="app-container"> <Header /> <div bind:this={contentDiv} class="content"> {@render children?.()} <Footer /> </div> </div> ``` ACKs for top commit: josecelano: ACK 3f22176 Tree-SHA512: 09e1042539a441e581eb8cfd759454ac675971acfbf2a0c3fa9eb74693270add836ac2e4864077e09cf29d4cb3be4d232c0dab607685e3f813e2548504ba9cef
Everything's working for Vue 🥳 ! I'm trying to fix the bugs for Svelte and Nuxt before releasing this. It might be best to update Svelte and Nuxt to their latest versions, but I've got next to no knowledge of these frameworks. I guess it should happen in another PR. |
Yeah it's already pretty big, let's do that in separate PRs |
@Akryum I admit, I'm a bit stuck with the Svelte/Nuxt fix, and I'm not sure I'll have a lot of time in the upcoming days... Feel free to do anything you want on the PR! Btw, I think this should be a new major version of Histoire considering all the changes. About Svelte 5On a side note, I also tried to make it work with the next version of Svelte without success yet. The compiled component included some "internal" imports, which resulted in this error when trying to launch the svelte example:
Not quite sure how to fix this... |
Maybe do a prerelease of the next major while Svelte/Nuxt support is being worked on? That way the Vue + Vite 6 can be tried out and verified by the community in the meanwhile :) |
@Akryum Wdyt? Could you publish an alpha version? Like |
Yes it's gonna be a big release so prerelases make sense |
BTW, you don't have to wait for the release to try it out as Histoire has automatic releases. |
Description
Fix #769
Additional context
What is the purpose of this pull request?